<template>
    <div class="down-agent">
        <div class="down-agent-card">
            <Card>
                <p slot="title">
                    <a><Icon type="person-stalker"></Icon> {{name}} 下级区代</a>
                </p>
                <i-table height="700" stripe :columns="columns" :data="data"></i-table>
            </Card>
        </div>
    </div>
</template>

<script>
    export default {
        name: "down-agent",
        data(){
            return{
                columns:[
                    {
                        title: '序号',
                        type: 'index',
                        width: 60,
                        align:"center",
                    },
                    {
                        title: '账号',
                        key: 'user',
                        align:"center",
                    },
                    {
                        title: '注册时间',
                        key: 'add_time',
                        align:"center",
                        render:(h,params)=>{
                            return this.timeFormat(params.row.add_time)
                        }
                    },
                    {
                        title: '消费金额',
                        key: 'money',
                        align:"center",
                        render:(h,params)=>{
                            return params.row.money||0
                        }
                    },
                ],
                data:[],
                name:"",
            }
        },
        mounted(){
            this.getData(this.$route.query.id)
            this.name = this.$route.query.name
        },
        methods:{
            getData(userId){
                this.getJsonData("Users/getDownDaili",{userId})
                    .then((res)=>{
                        this.data=res.data||[]
                    })
            }
        }
    }
</script>

<style lang="less">
    @import "down-agent";
</style>